home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Sunday Times: The Month 2004 October
/
The Sunday Times - The Month 2004-10.iso
/
pc
/
assets
/
bespoke
/
kids
/
cartoon.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2004-05-26
|
2KB
|
82 lines
var ASSETS = "../../../../../html/issue11/assets/";
XMLdata = new XML();
XMLdata.ignoreWhite = true;
XMLdata.onLoad = function(success)
{
if(success)
{
init();
}
else
{
trace("!!! Problem loading XML...");
}
};
if(Tardis)
{
XMLdata.load(Tardis.ASSETS_FOLDER + "bespoke/kids/cartoon.xml");
}
else
{
XMLdata.load("cartoon.xml");
}
init = function()
{
gotoAndStop(2);
if(Tardis)
{
filePath = Tardis.ASSETS_FOLDER;
}
else
{
filePath = ASSETS;
}
filePath += XMLdata.firstChild.attributes.filepath;
currentPage = 1;
pageCount = XMLdata.firstChild.childNodes.length;
XMLdata.page = XMLdata.firstChild.firstChild;
showPage();
};
closeCartoon = function()
{
Tardis.OverlayController.removeLastOverlay();
};
navigate = function(pPageModifier)
{
if(pPageModifier > 0)
{
XMLdata.page = XMLdata.page.nextSibling;
currentPage++;
}
else
{
XMLdata.page = XMLdata.page.previousSibling;
currentPage--;
}
showPage();
};
showPage = function()
{
if(!pageHolder_mc)
{
createEmptyMovieClip("pageHolder_mc",1);
}
var _loc1_ = filePath + XMLdata.page.firstChild.nodeValue;
pageHolder_mc.loadMovie(_loc1_);
updateButtons();
};
updateButtons = function()
{
mc_controls.forward_btn._visible = true;
mc_controls.back_btn._visible = true;
if(currentPage == 1)
{
mc_controls.back_btn._visible = false;
}
if(currentPage == pageCount)
{
mc_controls.forward_btn._visible = false;
}
};
stop();